<%--
  Created by IntelliJ IDEA.
  User: yuzhihao
  Date: 2022/4/12
  Time: 18:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/mycoupon.css">
    <link rel="stylesheet" href="${pageContext.request.contextPath}/layui/css/layui.css">
    <link rel="shortcut icon" href="${pageContext.request.contextPath}/image/smallLogo.svg" type="image/x-icon">
    <script src="${pageContext.request.contextPath}/js/jquery-3.6.0.min.js"></script>
    <script src="${pageContext.request.contextPath}/layui/layui.js"></script>

    <style>

        <%--        悬浮在a标签上会出现的效果--%>
        .cus_title .logo .title_list li a:hover + span {
            background-image: url("${pageContext.request.contextPath}/image/list_buttom.png");
            background-size: 12px 6px;
        }

        /*给a标签上色*/
        .cus_title .logo .title_list li .current_page {
            color: #23b7b7 !important;
        }

        /*给span标签加三角形*/
        .cus_title .logo .title_list li .current_page_bottom {
            background-image: url("${pageContext.request.contextPath}/image/list_buttom.png");
            background-size: 12px 6px;
        }

    </style>
</head>
<body>
<jsp:include page="../common/head.jsp"/>


<div class="cus_body">
    <div class="left_info">
        <ul class="left_info_ul">
            <li class="left_title">
                <span>我的神行</span>
            </li>
            <li class="left_body">
                <a href="${pageContext.request.contextPath}/customer/customer_info.jsp">用户信息</a>
            </li>
<%--            <li class="left_body">--%>
<%--                <a href="">我的收藏</a>--%>
<%--            </li>--%>
            <li class="left_body">
                <a href="${pageContext.request.contextPath}/ordermanage">订单管理</a>
            </li>
            <li class="left_body">
                <a href="${pageContext.request.contextPath}/customer/coupon/${customer.memberId}" class="click_style">我的优惠券</a>
            </li>
            <li class="left_body">
                <a href="${pageContext.request.contextPath}/message">我的消息</a>
            </li>
        </ul>
    </div>
    <div class="right_info">
        <div class="right_title">
            <h2>我的优惠券</h2>
        </div>
        <div class="right_body">
            <div class="right_body_box">
                <div class="right_body_info">
                    <table width="100%">
                        <tr>
                            <th width="20%">券号</th>
                            <th width="15%">面额</th>
                            <th width="15%">有效金额</th>
                            <th width="20%">有效期至</th>
                            <th width="15%">当前状态</th>
                            <th width="10%">操作</th>
                        </tr>
                        <c:if test="${!empty toreceivecoupon}">
                            <tr>
                                <td width="100%"><a
                                        href="${pageContext.request.contextPath}/coupon/${customer.memberId}">${toreceivecoupon}</a>
                                </td>
                            </tr>
                        </c:if>
                        <c:if test="${!empty coupon}">
                            <c:forEach items="${coupon}" var="list">
                                <tr>
                                    <td width="20%">${list.couponNo}</td>
                                    <td width="15%" style="text-align: center">${list.ownCouponPrice}</td>
                                    <td width="15%" style="text-align: center">${list.ownCouponValidprice}</td>
                                    <td width="20%" style="text-align: center"><fmt:formatDate value="${list.couponEndtime}"
                                                                    pattern="yyyy-MM-dd"/></td>
                                    <td width="15%" style="text-align: center">
                                        <c:if test="${list.ownCouponStatus eq 0}">
                                            未使用
                                        </c:if>
                                        <c:if test="${list.ownCouponStatus eq 1}">
                                            已使用
                                        </c:if>
                                        <c:if test="${list.ownCouponStatus eq 2}">
                                            已过期
                                        </c:if>
                                    </td>
                                    <td width="10%" style="text-align: center">
                                        <c:if test="${list.ownCouponStatus eq 0}">
                                            <a href="${pageContext.request.contextPath}/car/getAll/page/1">使用</a>
                                        </c:if>
                                        <c:if test="${list.ownCouponStatus eq 1}">
                                            <a href="${pageContext.request.contextPath}/myorder/${customer.memberId}/${list.ownCouponId}">查看订单</a>
                                        </c:if>
                                        <c:if test="${list.ownCouponStatus eq 2}">
                                            <a href="javascript:void (0);" style="color: #999999 !important;">已失效</a>
                                        </c:if>
                                    </td>
                                </tr>
                            </c:forEach>
                        </c:if>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>

</body>
</html>
